package io.yuncheng.modules.sys.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.*;

/**
 * 汇总
 *
 * @author jared
 * @email 15721509625@163.com
 * @date 2020-11-28 17:28:02
 */
@Data
public class SubAppLogCollectObjectVo implements Serializable {
    SubAppLogCollectVo encryptionNum;
    SubAppLogCollectVo loginUser;
    SubAppLogCollectVo appNum;
    SubAppLogCollectVo callTotal;
    SubAppLogCollectVo inUseNum;

   // SubAppLogCollectVo voCallRatioTotal;

    SubAppLogCollectVo appNumCurrent;
    SubAppLogCollectVo callCurrent;
    SubAppLogCollectVo inUseNumCurrent;
    SubAppLogCollectVo ratioTotalCurrent;
    SubAppLogCollectVo callMonthCurrent;
    public  void addTotal(SubAppLogCollectObjectVo childVo){
        this.getEncryptionNum().onlyAddTotal(childVo.getEncryptionNum());
        this.getLoginUser().onlyAddTotal(childVo.getLoginUser());
        this.getAppNum().onlyAddTotal(childVo.getAppNum());
        this.getCallTotal().onlyAddTotal(childVo.getCallTotal());
        this.getInUseNum().onlyAddTotal(childVo.getInUseNum());
    }

    public Map buildReturnVo(){
        SubAppLogCollectObjectVo vo = this;
        Map<String, Object> map = new HashMap<>(4);
        List<SubAppLogCollectVo> subAppLogCollectVos = Arrays.asList(vo.getAppNum().buildMapForList(), vo.getInUseNum().buildMapForList(), vo.getEncryptionNum().buildMapForList(), vo.getLoginUser().buildMapForList(), vo.getCallTotal().buildMapForList());
        map.put("charArray", subAppLogCollectVos);
        List<SubAppLogCollectVo.VoEntity> currentData = Arrays.asList(vo.getAppNumCurrent().getTotal(), vo.getInUseNumCurrent().getTotal(), vo.getCallCurrent().getTotal());
        map.put("currentData", currentData);
        map.put("ratioTotalCurrent", vo.getRatioTotalCurrent().buildMapForList());
        map.put("currentMonthData", vo.getCallMonthCurrent().buildMapForList());
        return map;
    }
}
